import { defineManifest } from '@crxjs/vite-plugin'
import pkg from './package.json'

export default defineManifest({
  manifest_version: 3,
  name: pkg.name,
  version: pkg.version,
  icons: {
    48: 'public/logo.png',
  },
  action: {
    default_icon: {
      48: 'public/logo.png',
    },
    default_popup: 'src/popup/index.html',
  },
  content_scripts: [{
    js: ['src/content/main.js'],
    matches: ['https://wz.mala.cn/wz/wzinfo?wid=*'],
  }],
  permissions: [
    'sidePanel',
    'contentSettings',
    "contextMenus",
    "tabs",
    "action",
    "notifications",
    "webRequest",
    "webRequestBlocking",
    "storage",
    "cookies",
    "activeTab",
  ],
  background: {
    service_worker: 'src/background/background.js',
    type: 'module',
  },
  side_panel: {
    default_path: 'src/sidepanel/index.html',
  },
})
